package com.seu.me.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by liangfeihu on 2018/9/1.
 */
public class Stream03 {
    public static void main(String[] args) {
        String phones = "15214353021,\n" +
                "15214353022,\n" +
                "15214353023,\n" +
                "15214353024,\n\n" +
                "15214353025,\n" +
                "15214353026,\n" +
                "15214353027,\n\n" +
                "15214353028,\n" +
                "15214353029";
        String[] phoneArrays = phones.trim().split(",");
        System.out.println(Arrays.toString(phoneArrays));


        //String[] array = Arrays.stream(phoneArrays).map(phone -> phone.trim()).toArray(String[]::new);

        List<String> collect = Arrays.stream(phoneArrays).map(phone -> phone.trim()).collect(Collectors.toList());

        System.out.println(collect.toString());

    }
}
